home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs66.d81
/
routines.prg
(
.txt
)
< prev
next >
Wrap
GEOS ConVerT
|
2009-10-10
|
7KB
|
250 lines
>&Routines
SEQ formatted GEOS file V1.0
Comm. Compat.
text file
BLASTER'S CONVERTER V2.5
Swap File
Swap1File
text album V2.1
Routines for use in GEOS applications.
1` Z<
ClearScrn: lda #2 ;use stipple pattern because it's the standard
jsr SetPattern
jsr i_Rectangle
.byte 0,199
.word 0,319
ldy #0 ;r6 points to the disk's name
10$: lda (r6),y
cmp #$a0
beq 20$
cpy #17
bcc 10$
20$: lda #0
sta (r6),y
GetDskNm: ldx #r6 ;r6 because it fits in well with dialog boxes
jsr GetPtrCurDkNm ;gets diskname and inserts a null terminator
ldy #0 ;r6 points to the disk's name
10$: lda (r6),y
cmp #$a0
beq 20$
cpy #17
bcc 10$
20$: lda #0
sta (r6),y
GetDskNm: ldx #r6 ;r6 because it fits in well with dialog boxes
jsr GetPtrCurDkNm ;gets diskname and inserts a null terminator
ldy #0 ;r6 points to the disk's name
10$: lda (ri
CheckError: cpx #0 ;check x reg for disk error and display if not zero
bne 30$
30$: stx r15H
LoadW r0,errorbox
jsr DoDlgBox
jmp EnterDeskTop
errorbox: .byte DEF_DB_POS|1,DB_USR_ROUT
.word ErrorPrnt
.byte OK,9,72,0
ErrorPrnt: jsr i_PutString
.word 80
.byte 48,24,"Disk Error: ",27,0
MoveB r15H,r0L
LoadB r0H,0
lda #%11000000
jmp PutDecimal
%11000000
jmp PutDecimal
Swtch3D: lda curDrive ;checks three drives for a readable disk
5$: add #1
cmp #11
bne 10$
lda #8
10$: pha
jsr SetDevice
jsr OpenDisk
cpx #0
bne 5$
;same as on Apple GEOS
;Written by Dan Kaufman and Chris Hawley of GeoWorks, Inc.
Bell: php
ldx CPU_DATA
LoadB CPU_DATA,IO_IN
LoadB $d404,0
sta $d405
LoadB $d418,$18
LoadB $d406,$30
LoadW $d402,$800
LoadB $d415,0
sta $d416
sta $d417
LoadB $d405,6
LoadB $d406,0
LoadB $d400,$df
LoadB $d401,$25
LoadB $d404,65
stx CPU_DATA
CopyLine:
CopyScreenBlock:
;same as on Apple GEOS system
EraseCharacter:
;This routine does not properly handle italics style charcters.
ldx currentMode
jsr GetRealSize
sta r3L
lda r1H
sub r3L
sta r2L
add r2L
sta r2H
sty r3L
lda r11L
sub r3L
sta r3L
ldy r11H
bcs 10$
10$: sty r3H
MoveW r11,r4
jmp Rectangle
$8808
.byte 1,0
.word $0040
.byte 1,0
.word obj0Pointer
.byte 8,$28,$29,$2a,$2b,$2c,$2d,$2e,$2f
.word 0
word obj0Pointer
.byte 8,$28,$29,$2a,$2b,$
;same as on Apple GEOS system
GetPattern: tay
PushW curPattern
jsr SetPattern
ldy #7
10$: lda (curPattern),y
sta (r0),y
bpl 10$
PopW curPattern
;same as on Apple GEOS system
SetUserPattern:
jsr SetPattern
ldy #7
10$: lda (r0),y
sta (curPattern),y
bpl 10$
2L,minutes
MoveB r2H,seconds
;same as on Apple GEOS system
SetTimeDate:
MoveB r0L,year
MoveB r0H,month
MoveB r1L,day
MoveB r1H,hour
MoveB r2L,minutes
MoveB r2H,seconds
;same as on Apple GEOS system
SaveFontData:
ldx #8
5$: lda baselineOffSet,x
sta saveFontTab,x
bpl 5$
seconds
bpl 10$
PopW curPattern
;same as on Apple GEOS system
RestoreFontData:
ldx #8
5$: lda saveFontTab,x
sta baselineOffSet,x
bpl 5$
seconds
bpl 10$
PopW curPattern
;same as on Apple GEOS system
SetAlarm: LoadB alarmSetFlag,$ff
PushB r0H
LoadB r1L,10
LoadB r0H,0
sta r1H
ldx #r0
ldy #r1
jsr Ddiv
jsr set2alarm
sta r1L
PopB r0L
jsr Ddiv
jsr set2alarm
sta r1H
PushB CPU_DATA
LoadB CPU_DATA,IO_IN
lda cia1base+$0f
ora #$80
sta cia1base+$0f
CmpBI r1L,$12
bcc 10$
sub #$12
eor #$80
10$: sta cia1base+$0b
MoveB r1H,cia1base+$0a
PopB CPU_DATA
set2alarm: lda r0L
asl a
asl a
asl a
asl a
ora r8L
asl a
ora r8L
;same as on Apple GEOS system
ResetAlarm: LoadB alarmSetFlag,0
tern),y
bpl 10$
2L,minutes
MoveB r2H,seconds
bpl 10$
PopW curPattern
ColorRect: ;Pass: r0L = left of rectangle in cards
; r1L = top of rectangle in cards
; r2L = width of rectangle in cards
; r2H = height of rectangle in cards
; r0H = color to store (in fore/back nybble format)
ldy r1L
LoadB r1L,0
sta r1H
5$: AddVW 40,r1
bne 5$
AddVW COLOR_MATRIX,r1
AddBW r0,r1
ldx r2H
5$: lda r0H
ldy r2L
10$: sta (r1),y
bpl 10$
AddVW 40,r1
bne 5$
InitVars: CmpBI version,$12
bcs 10$
jmp Quit
10$: LoadB dispBufferOn,ST_WR_FORE
MoveB curDriv
DoQuit: jsr GotoFirstMenu
CmpB appDrive,curDrive ;essential with three drives to return to
beq 10$ ;the proper drive or DeskTop will crash
jsr SetDevice
jsr OpenDisk
10$: jmp EnterDeskTop
appDrive: .block 1 ;saved on startup
ClearScrn
GetDskNm
CheckError
Swtch3D
racter
Character
EraseCharacter
GetPattern
SetUserPattern
SetTimeDate
SaveFontData
RestoreFontData
SetAlarm
ResetAlarm
ColorRect
DoQuit